package com.changgou.entity;

/**
 * @Description TODO
 * @ClassName BaseController
 * @Author YPK
 * @Date 15:18 2019/11/16
 * @Version 2.1
 **/
public class BaseController extends Result{
    public Result ok(String message) {
        return new Result(true, StatusCode.OK, message);
    }
    public Result ok(String message, int statusCode) {
        return new Result(true, statusCode, message);
    }

    public Result ok(String message, Object data) {
        return new Result(true, StatusCode.OK, message, data);
    }

    public Result ok(String message, int statusCode, Object data) {
        return new Result(true, statusCode, message, data);
    }

    public Result error(String message) {
        return new Result(false, StatusCode.ERROR, message);
    }

    public Result error(String message, int statusCode) {
        return new Result(false, statusCode, message);
    }

    public Result error(String message, int statusCode, Object data) {
        return new Result(false, statusCode, message, data);
    }
}
